package com.manner.groupon.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Manner
 * @Description: Mybatis-Plus配置
 * @DateTime: 2024/10/4 17:47
 */
@Configuration
public class MybatisPlusConfig {

    /**
     * 分页插件拦截器配置
     *
     * @return MybatisPlusInterceptor
     * @author Manner
     * @date 2024/10/4 17:48
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        // 分页插件
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}
